const tokenKey = process.env.VUE_APP_ACCESS_TOKEN;

export function tokenExists() {
  return localStorage.getItem(tokenKey) != null;
}

export function saveToken(token) {
  localStorage.setItem(tokenKey, JSON.stringify(token))
}

export function getToken() {
  let token = localStorage.getItem(tokenKey);
  return token === null ? null : JSON.parse(token);
}

export function removeToken() {
  localStorage.removeItem(tokenKey);
}
